#ifndef PROCESSMANAGER_H
#define	PROCESSMANAGER_H

#include <vector>
#include "processcb.h"
#include "openuserfile.h"

#define NO_PARENT -1

class ProcessManager
{
public:
	ProcessManager();
	~ProcessManager();

	
	int			getFreePID();
	int			findPIDByThread(Thread *thread);
	void		processFinished(int pid, int status);
	int			waitOn(int pid, int waitOnPID);

	ProcessCB*	getPCB(int pid);
	ProcessCB* 	constructPCB(Thread *thread, int parentPID);
	OpenUserFile* findOpenUserFileByName(char *fileName);
	void		handlePageFault(int vaddr);

private:	

	std::vector<ProcessCB*> pcbVector;
};


#endif // PROCESSMANAGER_H
